// D:\java-project\JavaFx\src\main\java\com\heima\ConnectionPoint.java
package com.heima;

import javafx.geometry.Point2D;

/**
 * 表示图形上的一个连接点（如上下左右）
 */
public class ConnectionPoint {
    private Point2D position;
    private String direction; // 如 "top", "bottom", "left", "right"
    private DrawableShape owner;

    public ConnectionPoint(double x, double y, String direction, DrawableShape owner) {
        this.position = new Point2D(x, y);
        this.direction = direction;
        this.owner = owner;
    }

    public Point2D getPosition() {
        return position;
    }

    public String getDirection() {
        return direction;
    }

    public DrawableShape getOwner() {
        return owner;
    }

    public void updatePosition(double x, double y) {
        this.position = new Point2D(x, y);
    }
}

